<template>
  <!-- 基干 -->
  <div class="EmergencyDetail">
    <div class="flex location-wrap">
      <span class="white">当前位置：</span>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/EDManagement' }">应急处置</el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path: '/DisasterSurveyReceiveList' }">灾情勘察</el-breadcrumb-item>
        <el-breadcrumb-item>详情</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="EmergencyDetail-center">
      <TimeLine :title="'应急事件流程'" :activities="actionTimeDataList" />
      <div class="EmergencyDetail-add">
        <div class="EmergencyDetail-titel">
          <div class="EmergencyDetail-top">基干队伍灾情现场勘察记录</div>
          <div class="flexBetween" style="border-bottom: 1px solid #EBEEF5;">
            <div slot="title" class="flex" style="width: 100%;">
              <div class="leftLine"></div>
              <div class="fontSize16">勘察进度</div>
            </div>
            <el-row style="margin-bottom: 6px;">
              <el-button size="mini" @click="AddFh">返回</el-button>
            </el-row>
          </div>
        </div>
        <!-- <div class="InformationDetail-btns">
          <div class="information_Sources_content">
            <div class="task_distribution">
              <div>勘察进度</div>
              <div>2021-08-12 20:00:00</div>
            </div>
          </div>
        </div> -->
        <div class="padding10-0">
          <div class="flexAround fontSize18 margin5-0">
            <div v-for="(item, index) in actionDataList" :key="index">{{ item.businessAction }}</div>
          </div>
          <el-steps :active="6" align-center>
            <el-step v-for="(item, index) in actionDataList" :key="index">
              <template slot="icon">
                <span class="yuandian1 ydBgcolor"></span>
              </template>
              <template slot="title">
                <div class="fontWeight textNowrap">{{ item.businessTime }}</div>
              </template>
            </el-step>
          </el-steps>
        </div>
        <div class="EmergencyDetail-zt">
          <el-collapse v-model="activeNames">
            <!-- <el-collapse-item name="1">

            </el-collapse-item> -->
            <el-collapse-item name="2">
              <div slot="title" class="flex">
                <div class="leftLine"></div>
                <div class="fontSize16">信息来源</div>
              </div>
              <div class="information_Sources_content">
                <div class="task_distribution">
                  <div style="font-size: 16px;font-family: Microsoft YaHei;">&nbsp;&nbsp;响应命令单：<span
                      style="color:#3561FD;">{{ detailsData.sourceInfo }}</span></div>
                </div>
              </div>
            </el-collapse-item>
            <el-collapse-item name="3">
              <div slot="title" class="flex">
                <div class="leftLine"></div>
                <div class="fontSize16">任务内容</div>
              </div>
              <div class="information_Sources_content" style="padding: 0 20px">
                <el-row style="font-size: 16px;font-family: Microsoft YaHei;">
                  <el-col :span="8">
                    <div class="grid-content bg-purple">&nbsp;&nbsp;&nbsp;&nbsp;任务单名称：{{ detailsData.surveyName }}</div>
                  </el-col>
                  <el-col :span="8">
                    <div class="grid-content bg-purple-light">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;任务内容：{{ detailsData.taskContent }}</div>
                  </el-col>
                  <el-col :span="8">
                    <div class="grid-content bg-purple">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;任务地点：{{ detailsData.taskAddress }}</div>
                  </el-col>
                </el-row>
                <el-row style="margin: 10px 0;font-size: 16px;font-family: Microsoft YaHei;">
                  <el-col :span="8">
                    <div class="grid-content bg-purple">派发单位/部门：{{ detailsData.distributedUnit }}</div>
                  </el-col>
                  <el-col :span="8">
                    <div class="grid-content bg-purple-light">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;派发人：{{ detailsData.creator
                      }}
                    </div>
                  </el-col>
                  <el-col :span="8">
                    <div class="grid-content bg-purple">计划开始时间：{{ detailsData.startTime }}</div>
                  </el-col>
                </el-row>
                <el-row style="font-size: 16px;font-family: Microsoft YaHei;">
                  <el-col :span="8">
                    <div class="grid-content bg-purple">责任单位/部门：{{ detailsData.dutyUnit }}</div>
                  </el-col>
                  <el-col :span="8">
                    <div class="grid-content bg-purple-light">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;责任人：{{
                        detailsData.dutyOfficer }}
                    </div>
                  </el-col>
                  <el-col :span="8">
                    <div class="grid-content bg-purple">计划结束时间：{{ detailsData.endTime }}</div>
                  </el-col>
                </el-row>
              </div>
            </el-collapse-item>
            <el-collapse-item name="4">
              <div slot="title" class="flex">
                <div class="leftLine"></div>
                <div class="fontSize16">勘察记录</div>
              </div>
              <div class="information_Sources_content" style="padding: 0 20px">
                <!-- 循环体 -->
                <div v-for="(res, index1) in detailsRecordsList" :key="index1">
                  <el-row style="font-size: 16px;font-family: Microsoft YaHei;">
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;勘察单位：{{ res.surveyUnit }}</div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple-light">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;部门/班组：{{ res.department }}</div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;专业：{{
                          res.major }}
                      </div>
                    </el-col>
                  </el-row>
                  <el-row style="margin: 10px 0;font-size: 16px;font-family: Microsoft YaHei;">
                    <el-col :span="8">
                      <div class="grid-content bg-purple">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;勘察负责人：{{ res.surveyLeader }}</div>
                    </el-col>
                    <el-col :span="8">
                      <div style="display: flex;" class="grid-content bg-purple-light">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="width: 80px;">勘察人员：</span><span
                          style="display: flex;width: 360px;align-items: center;">{{ res.surveyMember }}</span></div>
                    </el-col>
                  </el-row>
                  <el-row style="font-size: 16px;font-family: Microsoft YaHei;">
                    <el-col :span="8">
                      <div class="grid-content bg-purple">站内灾情概述：{{ res.disasterOverview }}</div>
                    </el-col>
                  </el-row>
                  <el-row style="margin: 10px 0;font-size: 16px;font-family: Microsoft YaHei;">
                    <el-col :span="8">
                      <div class="grid-content bg-purple">人员伤亡情况：{{ res.injuriesOverview }}</div>
                    </el-col>
                  </el-row>
                  <el-row style="font-size: 16px;font-family: Microsoft YaHei;">
                    <el-col :span="8">
                      <div class="grid-content bg-purple">周边环境条件：{{ res.environment }}</div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple-light">公共通讯情况：{{ res.communicationSituation }}</div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其他情况：{{ res.otherOverview }}</div>
                    </el-col>
                  </el-row>
                </div>
                <div slot="title" class="flex">
                  <div class="fontSize16" style="margin-top: 10px;">站内设备受损详情</div>
                </div>
                <el-table border
                  :header-cell-style="{ background: '#B1C8F9', color: '#000000', border: '1px solid #ccc', fontSize: '16px' }"
                  ref="multipleTable" :data="detailsDataListBd" tooltip-effect="dark" style="width: 100%" size="small">
                  <el-table-column prop="deviceName" label="变电站名称" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="deviceType" label="设备类型" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="voltageLevel" label="电压等级" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="deviceDualName" label="设备双重名称" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="damagedPlace" label="受损部位" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="deviceModel" label="设备型号" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="manufacturer" label="生产厂商" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="damagedOverview" label="受损情况" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column align="center" label="图片" width="100">
                    <template slot-scope="scope">
                      <div @click="handleClick(scope.row)"
                        style="font-size: 16px;color:#0000FF;cursor:pointer;width:40px;border-bottom: 1px solid #0000FF;margin: 0 auto;">
                        查看</div>
                    </template>
                  </el-table-column>
                </el-table>
                <!--  -->
                <div slot="title" class="flex">
                  <div class="fontSize16" style="margin-top: 10px;">输电设备受损详情</div>
                </div>
                <el-table border
                  :header-cell-style="{ background: '#B1C8F9', color: '#000000', border: '1px solid #ccc', fontSize: '16px' }"
                  ref="multipleTable" :data="detailsDataListSd" tooltip-effect="dark" style="width: 100%" size="small">
                  <el-table-column prop="deviceName" label="输电线路名称" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="voltageLevel" label="电压等级" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="poleTowerNum" label="杆塔号" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="poleTowerModel" label="杆塔型号" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="damagedPlace" label="受损部位" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="damagedOverview" label="受损情况描述" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column align="center" label="图片" width="100">
                    <template slot-scope="scope">
                      <!-- <el-button @click="handleClick(scope.row)" type="primary" size="small">查看</el-button> -->
                      <div @click="handleClick(scope.row)"
                        style="font-size: 16px;color:#0000FF;cursor:pointer;width:40px;border-bottom: 1px solid #0000FF;margin: 0 auto;">
                        查看</div>
                    </template>
                  </el-table-column>
                  <el-table-column label="定位" show-overflow-tooltip align="center" width="260">
                    <!-- <template slot-scope="scope"> -->
                    <template slot-scope="scope">
                      <div style="font-size: 16px;">
                        <span>{{ scope.row.address }}</span>
                        <span style="font-size: 20px;color:#3561FD;"><i class="el-icon-location-outline"></i></span>
                      </div>
                    </template>
                  </el-table-column>
                </el-table>
                <!--  -->
                <div slot="title" class="flex">
                  <div class="fontSize16" style="margin-top: 10px;">物资需求计划</div>
                </div>
                <el-table border
                  :header-cell-style="{ background: '#B1C8F9', color: '#000000', border: '1px solid #ccc', fontSize: '16px' }"
                  ref="multipleTable" :data="detailsPlans" tooltip-effect="dark" style="width: 100%" size="small">
                  <el-table-column prop="suppliesName" label="物资名称" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="suppliesDesc" label="物料描述" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="perUnit" label="单位" show-overflow-tooltip align="center">
                  </el-table-column>
                  <el-table-column prop="number" label="数量" show-overflow-tooltip align="center">
                  </el-table-column>
                </el-table>
              </div>
            </el-collapse-item>
          </el-collapse>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import TimeLine from "@/components/component/timeLine.vue";
import { zqkcFeedbackGetRecordById, zqkcFeedbackAction, getFlowListAction } from "@/api/EmergencyDisposal/zqkc.js";
export default {
  name: "StatisticalDetails",
  components: { TimeLine },
  data() {
    return {
      activeNames: ["1", "2", "3", "4", "5"],
      actionDataList: [], // 进度
      detailsData: {},
      detailsRecordsList: [], // 勘察记录
      detailsDataListBd: [], // 基干/变电
      detailsDataListSd: [], // 输电
      detailsPlans: [], // 物资
      // activities: [
      //   {
      //     content: "应急事件上报",
      //     timestamp: "2021-09-28 18:00:00"
      //   },
      //   {
      //     content: "灾情统计",
      //     timestamp: "2021-09-28 18:00:00"
      //   },
      //   {
      //     content: "响应研判",
      //     timestamp: "2021-09-28 18:00:00"
      //   },
      //   {
      //     content: "响应命令单发布",
      //     timestamp: "2021-09-28 18:00:00"
      //   },
      //   {
      //     content: "应急指挥部成立",
      //     timestamp: "2021-09-28 18:00:00"
      //   },
      //   {
      //     content: "基干队伍灾情现场勘察记录",
      //     timestamp: "2021-09-28 18:12:00"
      //   }
      // ]
      actionTimeDataList: []
    };
  },
  mounted() {
    this.loadActionTime();
    this.loadAction(this.$route.query.id);
    this.GetApplyDetails(this.$route.query.id);
  },
  methods: {
    // 勘察进度
    async loadAction(id) {
      const res = await zqkcFeedbackAction({ id });
      console.log(res.data);
      this.actionDataList = res.data;
    },
    // 勘察进度 左侧时间轴
    async loadActionTime() {
      const res = await getFlowListAction({ emergencyId: this.$route.query.emergencyId });
      console.log(res.data);
      this.actionTimeDataList = res;
    },
    // 详情
    async GetApplyDetails(id) {
      const res = await zqkcFeedbackGetRecordById({ id });
      this.detailsData = res.base;
      console.log(this.detailsData);
      this.detailsRecordsList = res.records;
      console.log(this.detailsRecordsList);
      this.detailsDataListBd = res.bdDamaged; // 设备受损
      this.detailsDataListSd = res.sdDamaged; // 输电

      this.detailsPlans = res.plans; // 物资需求计划
    },
    // 返回上一级
    AddFh() {
      this.$router.go(-1);
    }
  }
};
</script>

<style scoped lang="less">
.EmergencyDetail {
  width: 100%;
  height: 100%;

  :deep(.el-timeline) {
    width: 85%;
    margin-left: 35px;
    margin-top: 30px;
  }

  :deep(.el-breadcrumb__inner.is-link) {
    font-weight: 100;
    color: #fff;
  }

  :deep(.el-breadcrumb__item:last-child .el-breadcrumb__inner) {
    color: #3270ff;
  }

  :deep(.el-breadcrumb) {
    font-size: 16px;
    line-height: initial;
  }

  .EmergencyDetail-center {
    width: 100%;
    height: 100%;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;

    .EmergencyDetail-add {
      width: 83%;
      height: 100%;
      background-color: #fff;
      border-radius: 5px;

      // padding: 0 10px;
      .EmergencyDetail-titel {
        width: 98%;
        margin: 0 auto;
        position: relative;
        padding: 20px 0;

        .EmergencyDetail-top {
          width: 80%;
          margin: 0 auto;
          text-align: center;
          font-family: 微软雅黑;
          font-weight: 400;
          font-style: normal;
          font-size: 28px !important;
        }

        .InformationDetail-btn {
          position: absolute;
          right: 5px;
          bottom: 5px;
          text-align: right;
        }
      }

      .InformationDetail-btns {
        width: 98%;
        padding: 10px 0;
        margin: 0 auto;
        border-bottom: solid 2px red;

        .task_distribution {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 0px 10px;
        }
      }

      .EmergencyDetail-zt {
        width: 98%;
        height: 70%;
        overflow-y: auto;
        margin: 0 auto;

        :deep(.el-button--text) {
          color: #606266;
          padding: 2px;
        }

        .EmergencyList-dialog-form-item {
          display: flex;
          justify-content: space-between;
          flex-wrap: wrap;
        }

        .leftLine {
          width: 6px;
          height: 20px;
          background: #236dfe;
          border-radius: 4px;
          margin: auto 8px auto 0;
        }

        .task_distribution {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 10px 30px 20px 30px;
        }
      }
    }
  }
}

.yuandian1 {
  display: inline-block;
  background-color: #ccc;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.ydBgcolor {
  background-color: #246dfd;
  box-shadow: 0px 0px 8px 0px rgb(10, 99, 241);
}

:deep(.el-timeline) {
  width: 85%;
  margin-left: 35px;
  margin-top: 30px;
}

:deep(.el-breadcrumb__inner.is-link) {
  font-weight: 100;
  color: #fff;
}

:deep(.el-breadcrumb__item:last-child .el-breadcrumb__inner) {
  color: #3270ff;
}

:deep(.el-breadcrumb) {
  font-size: 16px;
  line-height: initial;
}

:deep(.cell) {
  font-size: 16px;
}

:deep(.el-tooltip) {
  font-size: 16px;
}</style>
